<div class="backupForm">
	<h2>Backup</h2>
	<div class="nb">
		<p>When using email backups, you are responsible for the security of your data once it has been sent.</p>
	</div>
	<form action="<?= Router::url(array('controller'=>'settings', 'action'=>'backup')) ?>" method="post">
		<fieldset>
			<div class="input">
				<input type="checkbox" name="email" value="1" id="email" <?
				if ($email_confirmed) {
					?> checked="checked" <?
				} else {
					?> disabled="disabled" <?
				} ?> />
				<label for="email">Email backup file</label>
				<?
				if ($email_confirmed) {
					?>
					<p>Backups will be emailed to <span class="email"><?= $User['User']['email'] ?></span>.</p>
					<?
				} else {
					?><p>You need to confirm email address <span class="email"><?= $User['User']['email'] ?></span> first.
						<?= $html->link('Send me a confirmation code >>', array('controller'=>'users', 'action'=>'getconfirm')) ?></p>
					<?
				}
				?>
			</div>
			<div class="input">
				<input type="checkbox" name="compress" value="1" id="compress" checked="checked" />
				<label for="compress">Compress backup file using gzip ?</label>
			</div>
			<div class="input">
				<input type="submit" value="Backup Now >>" name="go" />
			</div>
		</fieldset>
	</form>
</div>

<h3>Backup History</h3>
<table class="index backups">
	<tr>
		<th>Date</th>
		<th>Email address</th>
	</tr>
<?
	foreach($backups as $b) {
		?><tr>
			<td><?= $time->niceShort($b['Backup']['created']) ?></td>
			<td><?= $b['Backup']['email'] ?></td>
		</tr><?
	}
?></table>